<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>法援宝</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../css/style.css" />
    <link rel="stylesheet" type="text/css" href="../css/lawyer_user.css" />
    <script type="text/javascript" src="../script/api.js"></script>
    <script type="text/javascript" src="../script/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="../script/mobile.js"></script>
    <script type="text/javascript" src="../script/lawyer.js"></script>
    <style>
        .look_demand {
            position: absolute;
            right: 0.6rem;
            color: #1c83ea;
        }

        .ask_list ul li .userName em {
            top: 0;
        }
    </style>
</head>

<body>
    <div id="secHeader">
        <header class="header">
            <a href="javascript:void(0);" onclick="api.closeWin()" class="back_btn"><img src="../image/head-fanhui.png" alt=""></a>
            <h2>委托订单</h2>
            <!--<a href="my_answer.html" class="myAnswer_btn">我的回答</a>-->
        </header>
    </div>
    <section class="ask_square">
        <div class="ask_list bid_list">
            <ul id='con'>

                <li class="active1">
                    <div class="userInfo">
                        <img src="../image/userimg2.jpg" alt="">
                        <div class="userName">
                            <h6>135****7574</h6>
                            <span>重庆 重庆市 <em>2018-11-18  15:18</em></span>
                        </div>
                        <a href="##" class="look_demand" onclick="chakan('+tj[i].id+')">查看需求</a>
                    </div>
                    <div class="comment_info">
                        <p>我打算和儿子他妈协议离婚，我给他两间房，但我想让她以后管儿子，管儿子结婚，上学，如果她同意，又怕她以后无法落实，我该怎么办？ </p>
                    </div>
                    <div class="ask_kinds">
                        <span>离婚协议</span>
                        <div class="ask_active">
                            <i></i>
                            <p>我要投标</p>
                        </div>
                    </div>
                    <div class="bid_price">
                        <p>委托报价:<i>3000-5000元</i></p>
                        <span class="look_num">58人浏览</span>
                        <span class="bid_num">4人竞标</span>
                    </div>
                </li>
                <li class="active">
                  <div class="userInfo">
                      <img src="../image/userimg2.jpg" alt="">
                      <div class="userName">
                          <h6>135****7574</h6>
                          <span>重庆 重庆市 <em>2018-11-18  15:18</em></span>
                      </div>
                      <a href="##" class="look_demand" onclick="chakan('+tj[i].id+')">查看需求</a>
                  </div>
                  <div class="comment_info">
                      <p>我打算和儿子他妈协议离婚，我给他两间房，但我想让她以后管儿子，管儿子结婚，上学，如果她同意，又怕她以后无法落实，我该怎么办？ </p>
                  </div>
                  <div class="ask_kinds">
                      <span>离婚协议</span>
                      <div class="ask_active">
                          <i></i>
                          <p>我要投标</p>
                      </div>
                  </div>
                  <div class="bid_price">
                      <p>委托报价:<i>3000-5000元</i></p>
                      <span class="look_num">58人浏览</span>
                      <span class="bid_num">4人竞标</span>
                  </div>
                </li>
                <li class="active2">
                  <div class="userInfo">
                      <img src="../image/userimg2.jpg" alt="">
                      <div class="userName">
                          <h6>135****7574</h6>
                          <span>重庆 重庆市 <em>2018-11-18  15:18</em></span>
                      </div>
                      <a href="##" class="look_demand" onclick="chakan('+tj[i].id+')">查看需求</a>
                  </div>
                  <div class="comment_info">
                      <p>我打算和儿子他妈协议离婚，我给他两间房，但我想让她以后管儿子，管儿子结婚，上学，如果她同意，又怕她以后无法落实，我该怎么办？ </p>
                  </div>
                  <div class="ask_kinds">
                      <span>离婚协议</span>
                      <div class="ask_active">
                          <i></i>
                          <p>我要投标</p>
                      </div>
                  </div>
                  <div class="bid_price">
                      <p>委托报价:<i>3000-5000元</i></p>
                      <span class="look_num">58人浏览</span>
                      <span class="bid_num">4人竞标</span>
                  </div>
                </li>

            </ul>
        </div>
    </section>


</body>

<script>
    var page = 1;
    var ajid = 0;
    var choose = 1;
    var sort = 0;

    apiready = function() {
        $api.fixStatusBar($api.dom('#secHeader'));
        api.setStatusBarStyle({
            style: 'light'
        });
        api.addEventListener({
            name: 'keyback'
        }, function(ret, err) {

        });

        api.addEventListener({
            name: 'scrolltobottom'
        }, function(ret, err) {
            toDoRequest();
        });

        //下拉刷新
        api.setRefreshHeaderInfo({
            visible: true,
            bgColor: 'rgba(255,255,255,255)',
            textColor: '#666',
            textDown: '下拉刷新',
            textUp: '释放刷新'
        }, function(ret, err) {
            toDoRefresh();
        });

    };


    function toDoRequest() {
        if (!loginCheck()) {
            return;
        }
        var p = {
            token: token,
            choose: choose,
            ajid: ajid,
            sort: sort,
            page: page
        };
        api.ajax({
            url: webSiteUrl + '/app/user/swt',
            method: 'post',
            data: {
                values: p
            }
        }, function(ret, err) {
            api.hideProgress();

            if (ret.code == 200) {

                html = "";
                var tj = ret.data;
                if (tj != null) {

                    for (var i = 0; i < tj.length; i++) {

                        if (tj[i].status == 2) {
                            html += '<li class="active1">'; //已成交
                        } else if (tj[i].status == 3) {
                            html += '<li class="active2">'; //已关闭
                        } else if (tj[i].status == 4) {
                            html += '<li class="active3">'; //已完成
                        } else {
                            html += '<li>';
                        }
                        if (ck(tj[i].icon)) {
                            var u = ''
                        } else {
                            var u = webSiteUrl
                        }

                        html += '<div class="userInfo"><img src="' + u + tj[i].icon + '" alt=""><div class="userName"><h6>' + tj[i].phone + '</h6><span>' + tj[i].addr + '<em>' + tj[i].time +
                            '</em></span></div><a href="##" class="look_demand" onclick="chakan(' + tj[i].id + ')">查看需求</a></div><div class="comment_info"  onclick="wtmyjoin(' + tj[i].id + ')"><p>' + tj[i].content +
                            '</p></div><div class="ask_kinds"><span>' + tj[i].ajtype + '</span><div class="ask_active"><i></i><p></p></div></div><div class="bid_price"><p>我的报价:<i>' + tj[i].price + '元</i></p><span class="look_num">' + tj[i].view +
                            '人浏览</span><span class="bid_num">' + tj[i].num + '人竞标</span></div></li>';



                    }
                }
                if (page == 1) {
                    $('#con').html(html);
                } else {
                    $('#con').append(html);
                }
                page++;


            } else {

                if (page == 1) {
                    $('#con').html('<p style="text-align:center">暂无数据</p>');
                }

            }
        });

    }

    function chakan(id) {
        api.openWin({
            name: 'chakan',
            url: 'chakan.html',
            reload: true,
            pageParam: {
                id: id,
                type: 2
            }
        });

    }



    function wtmyjoin(id) {
        api.openWin({
            name: 'wtmyjoin',
            url: 'wtmyjoin.html',
            reload: true,
            pageParam: {
                id: id,

            }
        });
    }

    function hzwt(id) {
        api.openWin({
            name: 'mutualAid_details_bid',
            url: 'mutualAid_details_bid.html',
            reload: true,
            pageParam: {
                id: id,
                type: 1

            }
        });

    }

    function zcwt(id) {
        api.openWin({
            name: 'mutualAid_details_bid',
            url: 'mutualAid_details_bid.html',
            reload: true,
            pageParam: {
                id: id,
                type: 2

            }
        });
    }
</script>

</html>
